<% @page_title = "Members" %>
<% @blurb = members_blurb %>

<div id="member_search" class="column prepend-1 span-5 append-1">

  <h3>Simple Search</h3>
  <% form_tag profiles_path, :method => 'get' do -%>
    <dl>
      <dt>Search for name or email:</dt>
      <dd><%= text_field_tag :search, params[:search], :class => 'autofocus' %></dd>
    </dl>
    <p><%= submit_tag "Search" %></p>
  <% end -%>

  <p id="member_search_advanced_link"><a href="" class="live">Advanced search</a></p>

  <div id="member_search_advanced">
    <h3>Advanced Search</h3>
    <% form_tag profiles_path, :method => 'get' do -%>
    <dl>
      <dt>University:</dt>
      <dd><%= text_field_tag :institution, params[:institution] %></dd>

      <dt>Position:</dt>
      <dd><%= text_field_tag :position, params[:position] %></dd>

      <dt>Department:</dt>
      <dd><%= text_field_tag :department, params[:department] %></dd>

      <dt>City:</dt>
      <dd><%= text_field_tag :city, params[:city] %></dd>
    </dl>
    <p><%= submit_tag "Search" %></p>
  <% end -%>
  </div>
</div>

<div class="column span-15 append-1 last">
  <% unless @profiles.size > 0 %>
    <p>We didn't find any profiles matching your search terms.</p>
  <% end %>

  <% @profiles.each do |profile| %>
    <%= render :partial => 'profile', :locals => { :profile => profile } %>
  <% end %>
</div>

<div class="column span-16 prepend-7 append-1">
  <%= will_paginate @profiles %>
</div>
